//
//  ViewPointView.m
//  FloatClouds
//
//  Created by 黄威 on 16/8/31.
//  Copyright © 2016年 黄威. All rights reserved.
//

#import "ViewPointView.h"
#import "Masonry.h"
@implementation ViewPointView

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.imageViewRight  = [[UIImageView alloc]init];
        self.imageViewRight.layer.masksToBounds = YES;
        self.imageViewRight.layer.cornerRadius = 5;
       [self.contentView addSubview:self.imageViewRight];
        
        self.title = [[BaseLabel alloc]init];
        self.title.font = [UIFont fontWithName:@"Helvetica" size:19];
        self.title.numberOfLines = 0;
        //self.title.textColor = [UIColor brownColor];
        [self.contentView addSubview:self.title];
        
        
        self.content = [[BaseLabel alloc]init];
        self.content.font = [UIFont fontWithName:@"Helvetica" size:14];
        self.content.numberOfLines = 1;
        self.content.textColor = [UIColor grayColor];
        self.content.textAlignment = NSTextAlignmentLeft;
        
        [self.contentView addSubview:self.content];
        
    }
    
    return self;
    
}


- (void)layoutSubviews{
    
    [super layoutSubviews];
    
    [self.imageViewRight mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(self.mas_width).multipliedBy(0.28);
        make.top.mas_equalTo(5);
        make.bottom.mas_equalTo(-5);
        make.right.mas_equalTo(-5);
    }];
    
    [self.title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(5);
        make.left.mas_equalTo(20);
        make.width.mas_equalTo(self.mas_width).multipliedBy(0.6);
        make.height.mas_equalTo(self.mas_height).multipliedBy(0.6);
    }];
    
    [self.content mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.title.mas_bottom).mas_equalTo(0);
        make.left.mas_equalTo(15);
        make.width.mas_equalTo(self.mas_width).multipliedBy(0.6);
        make.height.mas_equalTo(self.mas_height).multipliedBy(0.3);
    }];
  
    
}


@end
